package com.example.filetest;

import com.example.domain.Student;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;


/*
 * 将字符串转换为student对象,并且使用终结方法将student对象收纳到数组
 * */
public class Test07 {
    public static void main(String[] args) {

        ArrayList<String> strings = new ArrayList<>();
        Collections.addAll(strings, "zhangshan,23", "lisi,24", "wangwu,25");

        Student[] array = strings.stream().map(Student::new).toArray(Student[]::new);
        System.out.println(Arrays.toString(array));


    }
}
